<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>vue学习</title>
    <script src="./js/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <ul>
        <li @click="tabHandle(0)">正在热映</li>
        <li @click="tabHandle(1)">即时上映</li>
      </ul>
      <hr />
      <div v-show="showIndex==0">正在热映内容</div>
      <div v-show="showIndex==1">即时上映内容</div>
    </div>
    <script>
      const app = Vue.createApp({
        data() {
          return {
            showIndex: 0
          }
        },
        methods: {
          tabHandle(index) {
            // console.log(index)
            this.showIndex = index
          }
        }
      })
      app.mount('#app')
    </script>
  </body>
</html>
